YES 1.54
H-Termination proof of /home/matraf/haskell/eval_FullyBlown_Fast/List.hs
H-Termination of the given Haskell-Program with start terms could successfully be proven:
↳ HASKELL
↳ LR
mainModule List
| ((elemIndex :: Ordering -> [Ordering] -> Maybe Int) :: Ordering -> [Ordering] -> Maybe Int) |
module List where
| import qualified Maybe import qualified Prelude
|
| elemIndex :: Eq a => a -> [a] -> Maybe Int
elemIndex | x | = | findIndex (== x) |
|
| findIndex :: (a -> Bool) -> [a] -> Maybe Int
findIndex | p | = | Maybe.listToMaybe . findIndices p |
|
| findIndices :: (a -> Bool) -> [a] -> [Int]
findIndices | p xs | = | concatMap (\vv1 ->
case | vv1 of |
| (x,i) | -> | if p x then i : [] else [] |
| _ | -> | [] |
) (zip xs (enumFrom 0)) |
|
module Maybe where
| import qualified List import qualified Prelude
|
| listToMaybe :: [a] -> Maybe a
listToMaybe | [] | = | Nothing |
listToMaybe | (a : _) | = | Just a |
|
Lambda Reductions:
The following Lambda expression
\vv1→
case | vv1 of |
| (x,i) | → if p x then i : [] else [] |
| _ | → [] |
is transformed to
findIndices0 | p vv1 | =
case | vv1 of | | (x,i) | → if p x then i : [] else [] |
| _ | → [] |
|
The following Lambda expression
\ab→(a,b)
is transformed to
↳ HASKELL
↳ LR
↳ HASKELL
↳ CR
mainModule List
| ((elemIndex :: Ordering -> [Ordering] -> Maybe Int) :: Ordering -> [Ordering] -> Maybe Int) |
module List where
| import qualified Maybe import qualified Prelude
|
| elemIndex :: Eq a => a -> [a] -> Maybe Int
elemIndex | x | = | findIndex (== x) |
|
| findIndex :: (a -> Bool) -> [a] -> Maybe Int
findIndex | p | = | Maybe.listToMaybe . findIndices p |
|
| findIndices :: (a -> Bool) -> [a] -> [Int]
findIndices | p xs | = | concatMap (findIndices0 p) (zip xs (enumFrom 0)) |
|
|
findIndices0 | p vv1 | = |
case | vv1 of |
| (x,i) | -> | if p x then i : [] else [] |
| _ | -> | [] |
|
|
module Maybe where
| import qualified List import qualified Prelude
|
| listToMaybe :: [a] -> Maybe a
listToMaybe | [] | = | Nothing |
listToMaybe | (a : _) | = | Just a |
|
Case Reductions:
The following Case expression
case | vv1 of |
| (x,i) | → if p x then i : [] else [] |
| _ | → [] |
is transformed to
findIndices00 | p (x,i) | = if p x then i : [] else [] |
findIndices00 | p _ | = [] |
↳ HASKELL
↳ LR
↳ HASKELL
↳ CR
↳ HASKELL
↳ IFR
mainModule List
| ((elemIndex :: Ordering -> [Ordering] -> Maybe Int) :: Ordering -> [Ordering] -> Maybe Int) |
module List where
| import qualified Maybe import qualified Prelude
|
| elemIndex :: Eq a => a -> [a] -> Maybe Int
elemIndex | x | = | findIndex (== x) |
|
| findIndex :: (a -> Bool) -> [a] -> Maybe Int
findIndex | p | = | Maybe.listToMaybe . findIndices p |
|
| findIndices :: (a -> Bool) -> [a] -> [Int]
findIndices | p xs | = | concatMap (findIndices0 p) (zip xs (enumFrom 0)) |
|
|
findIndices0 | p vv1 | = | findIndices00 p vv1 |
|
|
findIndices00 | p (x,i) | = | if p x then i : [] else [] |
findIndices00 | p _ | = | [] |
|
module Maybe where
| import qualified List import qualified Prelude
|
| listToMaybe :: [a] -> Maybe a
listToMaybe | [] | = | Nothing |
listToMaybe | (a : _) | = | Just a |
|
If Reductions:
The following If expression
if p x then i : [] else []
is transformed to
findIndices000 | i True | = i : [] |
findIndices000 | i False | = [] |
↳ HASKELL
↳ LR
↳ HASKELL
↳ CR
↳ HASKELL
↳ IFR
↳ HASKELL
↳ BR
mainModule List
| ((elemIndex :: Ordering -> [Ordering] -> Maybe Int) :: Ordering -> [Ordering] -> Maybe Int) |
module List where
| import qualified Maybe import qualified Prelude
|
| elemIndex :: Eq a => a -> [a] -> Maybe Int
elemIndex | x | = | findIndex (== x) |
|
| findIndex :: (a -> Bool) -> [a] -> Maybe Int
findIndex | p | = | Maybe.listToMaybe . findIndices p |
|
| findIndices :: (a -> Bool) -> [a] -> [Int]
findIndices | p xs | = | concatMap (findIndices0 p) (zip xs (enumFrom 0)) |
|
|
findIndices0 | p vv1 | = | findIndices00 p vv1 |
|
|
findIndices00 | p (x,i) | = | findIndices000 i (p x) |
findIndices00 | p _ | = | [] |
|
|
findIndices000 | i True | = | i : [] |
findIndices000 | i False | = | [] |
|
module Maybe where
| import qualified List import qualified Prelude
|
| listToMaybe :: [a] -> Maybe a
listToMaybe | [] | = | Nothing |
listToMaybe | (a : _) | = | Just a |
|
Replaced joker patterns by fresh variables and removed binding patterns.
↳ HASKELL
↳ LR
↳ HASKELL
↳ CR
↳ HASKELL
↳ IFR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
mainModule List
| ((elemIndex :: Ordering -> [Ordering] -> Maybe Int) :: Ordering -> [Ordering] -> Maybe Int) |
module List where
| import qualified Maybe import qualified Prelude
|
| elemIndex :: Eq a => a -> [a] -> Maybe Int
elemIndex | x | = | findIndex (== x) |
|
| findIndex :: (a -> Bool) -> [a] -> Maybe Int
findIndex | p | = | Maybe.listToMaybe . findIndices p |
|
| findIndices :: (a -> Bool) -> [a] -> [Int]
findIndices | p xs | = | concatMap (findIndices0 p) (zip xs (enumFrom 0)) |
|
|
findIndices0 | p vv1 | = | findIndices00 p vv1 |
|
|
findIndices00 | p (x,i) | = | findIndices000 i (p x) |
findIndices00 | p vw | = | [] |
|
|
findIndices000 | i True | = | i : [] |
findIndices000 | i False | = | [] |
|
module Maybe where
| import qualified List import qualified Prelude
|
| listToMaybe :: [a] -> Maybe a
listToMaybe | [] | = | Nothing |
listToMaybe | (a : vx) | = | Just a |
|
Cond Reductions:
The following Function with conditions
is transformed to
undefined0 | True | = undefined |
undefined1 | | = undefined0 False |
↳ HASKELL
↳ LR
↳ HASKELL
↳ CR
↳ HASKELL
↳ IFR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ NumRed
mainModule List
| ((elemIndex :: Ordering -> [Ordering] -> Maybe Int) :: Ordering -> [Ordering] -> Maybe Int) |
module List where
| import qualified Maybe import qualified Prelude
|
| elemIndex :: Eq a => a -> [a] -> Maybe Int
elemIndex | x | = | findIndex (== x) |
|
| findIndex :: (a -> Bool) -> [a] -> Maybe Int
findIndex | p | = | Maybe.listToMaybe . findIndices p |
|
| findIndices :: (a -> Bool) -> [a] -> [Int]
findIndices | p xs | = | concatMap (findIndices0 p) (zip xs (enumFrom 0)) |
|
|
findIndices0 | p vv1 | = | findIndices00 p vv1 |
|
|
findIndices00 | p (x,i) | = | findIndices000 i (p x) |
findIndices00 | p vw | = | [] |
|
|
findIndices000 | i True | = | i : [] |
findIndices000 | i False | = | [] |
|
module Maybe where
| import qualified List import qualified Prelude
|
| listToMaybe :: [a] -> Maybe a
listToMaybe | [] | = | Nothing |
listToMaybe | (a : vx) | = | Just a |
|
Num Reduction: All numbers are transformed to thier corresponding representation with Pos, Neg, Succ and Zero.
↳ HASKELL
↳ LR
↳ HASKELL
↳ CR
↳ HASKELL
↳ IFR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ NumRed
↳ HASKELL
↳ Narrow
mainModule List
| (elemIndex :: Ordering -> [Ordering] -> Maybe Int) |
module List where
| import qualified Maybe import qualified Prelude
|
| elemIndex :: Eq a => a -> [a] -> Maybe Int
elemIndex | x | = | findIndex (== x) |
|
| findIndex :: (a -> Bool) -> [a] -> Maybe Int
findIndex | p | = | Maybe.listToMaybe . findIndices p |
|
| findIndices :: (a -> Bool) -> [a] -> [Int]
findIndices | p xs | = | concatMap (findIndices0 p) (zip xs (enumFrom (Pos Zero))) |
|
|
findIndices0 | p vv1 | = | findIndices00 p vv1 |
|
|
findIndices00 | p (x,i) | = | findIndices000 i (p x) |
findIndices00 | p vw | = | [] |
|
|
findIndices000 | i True | = | i : [] |
findIndices000 | i False | = | [] |
|
module Maybe where
| import qualified List import qualified Prelude
|
| listToMaybe :: [a] -> Maybe a
listToMaybe | [] | = | Nothing |
listToMaybe | (a : vx) | = | Just a |
|
Haskell To QDPs
↳ HASKELL
↳ LR
↳ HASKELL
↳ CR
↳ HASKELL
↳ IFR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ NumRed
↳ HASKELL
↳ Narrow
↳ AND
↳ QDP
↳ QDPSizeChangeProof
↳ QDP
↳ QDP
Q DP problem:
The TRS P consists of the following rules:
new_listToMaybe0(wx7, :(wx41110, wx41111)) → new_listToMaybe(wx41110, wx41111, new_primPlusNat(wx7), new_primPlusNat(wx7))
new_listToMaybe(EQ, wx4111, wx7, wx8) → new_listToMaybe0(wx7, wx4111)
new_listToMaybe(LT, :(wx41110, wx41111), wx7, wx8) → new_listToMaybe(wx41110, wx41111, new_primPlusNat(wx7), new_primPlusNat(wx7))
The TRS R consists of the following rules:
new_primPlusNat(Zero) → Succ(Zero)
new_primPlusNat0(Succ(wx500)) → Succ(wx500)
new_primPlusNat(Succ(wx50)) → Succ(Succ(new_primPlusNat0(wx50)))
new_primPlusNat0(Zero) → Zero
The set Q consists of the following terms:
new_primPlusNat(Succ(x0))
new_primPlusNat(Zero)
new_primPlusNat0(Zero)
new_primPlusNat0(Succ(x0))
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem. From the DPs we obtained the following set of size-change graphs:
- new_listToMaybe(EQ, wx4111, wx7, wx8) → new_listToMaybe0(wx7, wx4111)
The graph contains the following edges 3 >= 1, 2 >= 2
- new_listToMaybe(LT, :(wx41110, wx41111), wx7, wx8) → new_listToMaybe(wx41110, wx41111, new_primPlusNat(wx7), new_primPlusNat(wx7))
The graph contains the following edges 2 > 1, 2 > 2
- new_listToMaybe0(wx7, :(wx41110, wx41111)) → new_listToMaybe(wx41110, wx41111, new_primPlusNat(wx7), new_primPlusNat(wx7))
The graph contains the following edges 2 > 1, 2 > 2
↳ HASKELL
↳ LR
↳ HASKELL
↳ CR
↳ HASKELL
↳ IFR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ NumRed
↳ HASKELL
↳ Narrow
↳ AND
↳ QDP
↳ QDP
↳ QDPSizeChangeProof
↳ QDP
Q DP problem:
The TRS P consists of the following rules:
new_listToMaybe2(wx41110, wx41111, wx11, wx12) → new_listToMaybe1(wx41110, wx41111, new_primPlusNat(wx11), new_primPlusNat(wx11))
new_listToMaybe1(LT, :(wx411110, wx411111), wx14, wx13) → new_listToMaybe2(wx411110, wx411111, wx13, wx13)
new_listToMaybe3(wx13, :(wx411110, wx411111)) → new_listToMaybe2(wx411110, wx411111, wx13, wx13)
new_listToMaybe1(GT, wx41111, wx14, wx13) → new_listToMaybe3(wx13, wx41111)
The TRS R consists of the following rules:
new_primPlusNat(Zero) → Succ(Zero)
new_primPlusNat0(Succ(wx500)) → Succ(wx500)
new_primPlusNat(Succ(wx50)) → Succ(Succ(new_primPlusNat0(wx50)))
new_primPlusNat0(Zero) → Zero
The set Q consists of the following terms:
new_primPlusNat(Succ(x0))
new_primPlusNat(Zero)
new_primPlusNat0(Zero)
new_primPlusNat0(Succ(x0))
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem. From the DPs we obtained the following set of size-change graphs:
- new_listToMaybe1(LT, :(wx411110, wx411111), wx14, wx13) → new_listToMaybe2(wx411110, wx411111, wx13, wx13)
The graph contains the following edges 2 > 1, 2 > 2, 4 >= 3, 4 >= 4
- new_listToMaybe1(GT, wx41111, wx14, wx13) → new_listToMaybe3(wx13, wx41111)
The graph contains the following edges 4 >= 1, 2 >= 2
- new_listToMaybe3(wx13, :(wx411110, wx411111)) → new_listToMaybe2(wx411110, wx411111, wx13, wx13)
The graph contains the following edges 2 > 1, 2 > 2, 1 >= 3, 1 >= 4
- new_listToMaybe2(wx41110, wx41111, wx11, wx12) → new_listToMaybe1(wx41110, wx41111, new_primPlusNat(wx11), new_primPlusNat(wx11))
The graph contains the following edges 1 >= 1, 2 >= 2
↳ HASKELL
↳ LR
↳ HASKELL
↳ CR
↳ HASKELL
↳ IFR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ NumRed
↳ HASKELL
↳ Narrow
↳ AND
↳ QDP
↳ QDP
↳ QDP
↳ QDPSizeChangeProof
Q DP problem:
The TRS P consists of the following rules:
new_listToMaybe4(wx5, :(wx41110, wx41111)) → new_listToMaybe5(wx41110, wx41111, new_primPlusNat(wx5), new_primPlusNat(wx5))
new_listToMaybe5(EQ, :(wx41110, wx41111), wx5, wx6) → new_listToMaybe5(wx41110, wx41111, new_primPlusNat(wx5), new_primPlusNat(wx5))
new_listToMaybe5(GT, wx4111, wx5, wx6) → new_listToMaybe4(wx5, wx4111)
The TRS R consists of the following rules:
new_primPlusNat(Zero) → Succ(Zero)
new_primPlusNat0(Succ(wx500)) → Succ(wx500)
new_primPlusNat(Succ(wx50)) → Succ(Succ(new_primPlusNat0(wx50)))
new_primPlusNat0(Zero) → Zero
The set Q consists of the following terms:
new_primPlusNat(Succ(x0))
new_primPlusNat(Zero)
new_primPlusNat0(Zero)
new_primPlusNat0(Succ(x0))
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem. From the DPs we obtained the following set of size-change graphs:
- new_listToMaybe5(GT, wx4111, wx5, wx6) → new_listToMaybe4(wx5, wx4111)
The graph contains the following edges 3 >= 1, 2 >= 2
- new_listToMaybe5(EQ, :(wx41110, wx41111), wx5, wx6) → new_listToMaybe5(wx41110, wx41111, new_primPlusNat(wx5), new_primPlusNat(wx5))
The graph contains the following edges 2 > 1, 2 > 2
- new_listToMaybe4(wx5, :(wx41110, wx41111)) → new_listToMaybe5(wx41110, wx41111, new_primPlusNat(wx5), new_primPlusNat(wx5))
The graph contains the following edges 2 > 1, 2 > 2